# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgname=ropper
_pkgname=Ropper
pkgver=1.13.8
pkgrel=3
pkgdesc='Show information about binary files and find gadgets to build rop chains for different architectures'
url='https://github.com/sashs/Ropper'
arch=('any')
license=('GPL2')
depends=('python' 'python-capstone' 'python-filebytes' 'python-z3-solver'
         'python-pyvex' 'python-archinfo')
makedepends=('python-build' 'python-installer' 'python-wheel' 'python-setuptools')
checkdepends=('python-pytest')
optdepends=('python-keystone: assemble command support')
conflicts=('python-ropper')
replaces=('python-ropper')
provides=('python-ropper')
source=(https://github.com/sashs/${_pkgname}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha512sums=('eae2279e1c6bc91af76e8e5d37b7d57c5d2e518d027e293dbd52c6c27dcd8826e73673c55fe581cdefda272b657c8eff2b5eb4fdc4996fec1548709b8371b5d4')
b2sums=('8601bcd2287763aa208b227c437362b9799ec1775104b659213e69a77f118bce567e95a0b83a4f0556439a82ee853ebc9aabaa4098b2a700572d1b661213eb25')

build() {
  cd ${_pkgname}-${pkgver}
  python -m build --wheel --no-isolation
}

check() {
  cd ${_pkgname}-${pkgver}
  py.test
}

package() {
  cd ${_pkgname}-${pkgver}
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm 644 README.md sample.py -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et:
